<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        *{
            margin: 0px;
            padding: 0px;
        }
        li{
            list-style: none;
        }
        
        .nav{
            width:200px;
            height: 100px;
            margin:auto;
        }
        .nav li{
            width:20px;
            height: 20px;
            background-color: pink;
            margin: 3px 0;
            position: relative;
        }
        .nav li div{
            width:0;
            height: 20px;
            background-color: purple;
            position: absolute;
            right: 0;
            top: 0;
            transition: all .6s;
            z-index: -1;
        }
        .nav li:hover div{
            width: 100px;
        }
    </style>
</head>
<body>
    <div class="nav">
        <ul>
            <li><div></div></li>
            <li><div></div></li>
            <li><div></div></li>
            <li><div></div></li>
            <li><div></div></li>
        </ul>
    </div>
</body>
</html>